Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active October 23, 2022 16:43
Show Gist options
  • Save marketinview/2a7172dd9c599f83ca45 to your computer and use it in GitHub Desktop.
Save marketinview/2a7172dd9c599f83ca45 to your computer and use it in GitHub Desktop.
Qualtrics: Randomly reverse answer choices in multiple choice question. #qualtrics #js #jq #mc #random #reverse
Qualtrics.SurveyEngine.addOnload(function() {
var rand = Math.round(Math.random());
if(rand == 1) {
var choices = jQuery("#"+this.questionId+" li.Selection");
var lastChoice = choices.last();
for(i=0;i<choices.length-1;i++) { lastChoice.after(choices[i]); }
}
});
@marketinview
Copy link
Author

marketinview commented Nov 14, 2017

See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment